﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas1a13
    {
		private string _slistid;
		private string _pid;
		private string _spno;
        private int? _status;
		private string _muser;
		private string _listid;
		
        /// <summary>
        /// 销售商标识
        /// </summary>
		public string Slistid
		{
			get { return _slistid;	 }
			set { _slistid=value;	}
		}
        /// <summary>
        /// 商品标识
        /// </summary>
		public string Pid
		{
			get { return _pid;	 }
			set { _pid=value;	}
		}
        /// <summary>
        /// 销售商货号
        /// </summary>
		public string Spno
		{
			get { return _spno;	 }
			set { _spno=value;	}
		}
        /// <summary>
        /// 状态
        /// </summary>
		public int? Status
		{
			get { return _status;	 }
			set { _status=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Bas1a13> GetBas1a13ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas1a13> list = new List<Bas1a13>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas1a13 model = GetBas1a13ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas1a13 GetBas1a13ByDataRow(DataRow dr)
		{
			Bas1a13 model = new Bas1a13(); //实例化Bas1a13
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("slistid")&&!(dr["slistid"] is System.DBNull))  
				model.Slistid = ( string)dr["slistid"];
			if (dcc.Contains("pid")&&!(dr["pid"] is System.DBNull))  
				model.Pid = ( string)dr["pid"];
			if (dcc.Contains("spno")&&!(dr["spno"] is System.DBNull))  
				model.Spno = ( string)dr["spno"];
			if (dcc.Contains("status")&&!(dr["status"] is System.DBNull))  
				model.Status = ( int)dr["status"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
